package com.hspedu.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@Controller
public class UserHander {
    /**
     *
     */
    //@RequestMapping(value = "/buy",method = RequestMethod.POST)
    @PostMapping(value = "/buy")
    public String buy() {
        System.out.println("buy ok...");
        return "success";
    }

    @RequestMapping(value = "/find", params = "bookId", method = RequestMethod.GET)
    public String search(String bookId) {
        System.out.println("查询书籍 bookId= " + bookId);
        return "success";
    }

    @RequestMapping(value = "/message/**")
    public String im() {
        System.out.println("发送消息");
        return "success";
    }
    @RequestMapping(value = "/reg/{username}/{userid}")
    public String register(@PathVariable("username") String name,
            @PathVariable("userid")String id){
        System.out.println("接收到参数--" + "username= " + name + "--" + "userid= " + id);
        return "success";
    }

    @RequestMapping(value = "/hi")
    public String hi() {
        System.out.println("hi");
        return "success";
    }

    @GetMapping(value = "/hello3")
    public String hello3(String email) {
        System.out.println("hello3 " + email);
        return "success";
    }
}
